foods=['rice','noodles','baozi','jiaozi']
for food in foods:
	print('i like to eat '+food+'.\n')
print("i really like to eat foods.")
animals=['cat','dog','rabbit']
#英语中别忘记空格
for animal in animals:
	print('a '+animal+' will be a lovely pet.\n')
print('all of these pers are lovely!')
squares=[]
for value in range(1,11):#for函数遍历出来的结果是序列？
	square=value**2
	squares.append(square)
print(squares)
for num1 in range(1,21):
    print(num1)
#for num2 in range(1,1000001):
 #   print(num2)
#digits=list(range(1,1000001))#range是一系列的数字的范围要求，for的结果是生成一系列的相关数字，list则是生成列表
#print(max(digits))#我发现类似len、max这种函数，不用print，根本不出结果，就是算了，但是不显示
#print(min(digits))
#print(sum(digits))
num3=list(range(1,20,2))
for num in num3:
    print(num)
num4=list(range(3,31,3))
for num in num4:
	print(num)
num5=[num**3 for num in list(range(1,11))]
print(num5)
#4-10
print('the first three items in the list are:')
for food in foods[:3]:
	print(food)
print('three items from the middle of the list are:')
for food in foods[1:4]:
	print(food)
print('the last three items in the list are:')
for food in foods[1:]:
	print(food)
#4-11
freind_foods=foods[:]
foods.append('soup')
freind_foods.append('meat')
print('my favourite foods are: ')
for food in foods:
	print(food)
print("\nmy friend's favourite foods are: ")
for food in freind_foods:
	print(food)
my_foods=['pizza','falafel','carrot cake']
freind_foods=my_foods[:]
print('my favourite foods are: ')
print(my_foods)
print("\nmy friend's favourite foods are: ")
print(freind_foods)
#4-13
simple_foods=('cola','hamburge','fries','chicken','tools')
for food in simple_foods:
    print(food)
#simple_foods[1]='french' 被拒绝了
new_menus=('cola','french','fries','qixi','pie')
for menu in new_menus:
	print(menu)